#include <iostream>
using namespace std;

int main(int argc, char *argv[]) {
    cout << argv[0] << endl;
    if (argv == nullptr || argv[0] == nullptr) {
        cout << "E: No command line arguments provided." << endl;
        cout << "Usage: DevToolbox <command>" << endl;
        cout << "Opening Navigator..." << endl;
        system("bin/navigator.exe");
        return 0;
    } else if (argv[1] == "init") {
        cout << "Downloading Python Libraries..." << endl;
        system("pip install pyinstaller");
        system("pip install tqdm");
        system("pip install requests");
        system("pip install lxml");
        system("pip install pillow");
        system("pip install numpy");
        system("pip install pandas");
        system("pip install matplotlib");
        system("pip install scipy");
        system("pip install flask");
        system("pip install django");
        system("pip install fastapi");
        system("pip install sqlalchemy");
        system("pip install pytest");
        system("pip install black");
        system("pip install mypy");
        system("pip install jupyter");
        system("pip install notebook");
        system("pip install ipython");
        system("pip install virtualenv");
        system("pip install pipenv");
        system("pip install poetry");
        system("pip install sphinx");
        system("pip install twine");
        system("pip install setuptools");
        system("pip install wheel");
        system("pip install cython");
        system("pip install pyyaml");
        system("pip install cryptography");
        system("pip install paramiko");
        system("pip install fabric");
        system("pip install celery");
        system("pip install redis");
        system("pip install sqlparse");
        system("pip install pytest-cov");
        system("pip install coverage");
        system("pip install flake8");
        system("pip install pylint");
        system("pip install autopep8");
        system("pip install isort");
        system("pip install rope");
        system("pip install jedi");
        system("pip install watchdog");
        system("pip install httpx");
        system("pip install starlette");
        system("pip install uvicorn");
        system("pip install gunicorn");
        system("pip install gevent");
        system("pip install eventlet");
        system("pip install twisted");
        system("pip install bottle");
        system("pip install cherrypy");
        system("pip install hug");
        system("pip install connexion");
        system("pip install falcon");
        system("pip install pydantic");
        system("pip install orjson");
        system("pip install ujson");
        system("pip install simplejson");
        system("pip install pycryptodome");
        system("pip install bcrypt");
        system("pip install argon2-cffi");
        system("pip install passlib");
        system("pip install pyjwt");
        system("pip install python-dotenv");
        system("pip install loguru");
        system("pip install structlog");
        system("pip install rich");
        system("pip install textual");
        system("pip install prompt-toolkit");
        system("pip install click");
        system("pip install typer");
        system("pip install fire");
        system("pip install argparse");
        system("pip install docopt");
        system("pip install pydoc");
        system("pip install mkdocs");
        system("pip install mkdocs-material");
        system("pip install sphinx-rtd-theme");
        system("pip install alabaster");
        system("pip install nbsphinx");
        system("pip install sphinx-autodoc-typehints");
        system("pip install sphinxcontrib-napoleon");
        system("pip install pytest-django");
        system("pip install pytest-flask");
        system("pip install pytest-asyncio");
        system("pip install pytest-mock");
        system("pip install pytest-xdist");
        system("pip install pytest-benchmark");
        system("pip install pytest-sugar");
        system("pip install pytest-html");
        system("pip install pytest-cases");
        system("pip install pytest-timeout");
        system("pip install pytest-rerunfailures");
        system("pip install pytest-ordering");
        system("pip install pytest-env");
        system("pip install pytest-profiling");
        system("pip install pytest-lazy-fixture");
        system("pip install bs4");
        system("pip install scrapy");
        system("pip install selenium");
        system("pip install playwright");
        system("pip install httpie");
        system("pip install mitmproxy");
        system("pip install locust");
        system("pip install jmespath");
        system("pip install jsonschema");
        system("pip install pydash");
        system("pip install toolz");
        system("pip install cytoolz");
        system("pip install boltons");
        system("pip install more-itertools");
        system("pip install funcy");
        system("pip install dataclasses");
        system("pip install attrs");
        system("pip install pyrsistent");
        system("pip install pytorch");
        system("pip install tensorflow");
        system("pip install keras");
        system("pip install transformers");
        system("pip install datasets");
        system("pip install opencv-python");
        system("pip install scikit-learn");
        system("pip install xgboost");
        system("pip install lightgbm");
        system("pip install catboost");
        system("pip install fastai");
        system("pip install albumentations");
        system("pip install imgaug");
        system("pip install nltk");
        system("pip install openai");
        system("pip install langchain");
        system("pip install streamlit");
        system("pip install dash");
        system("pip install pygame");
        system("pip install pydub");
        system("pip install moviepy");
        system("pip install ffmpeg-python");
        system("pip install pyqt5");
        system("pip install pyside2");
        system("pip install kivy");
        cout << "Python Libraries downloaded successfully." << endl;
        cout << "Updating Python package..." << endl;
        system("pip install --upgrade pip");
        cout << "Python package updated successfully." << endl;
        return 0;
    } else if (argv[1] == "navigator") { // Open Navigator
        cout << "Opening Navigator..." << endl;
        system("bin/navigator.exe");
        return 0;
    } else if (argv[1] == "update") { // Update Python libraries
        cout << "Updating initlaze libraries..." << endl;
        system("pip install pyinstaller --upgrade ");
        system("pip install tqdm --upgrade ");
        system("pip install requests --upgrade ");
        system("pip install lxml --upgrade ");
        system("pip install pillow --upgrade ");
        system("pip install numpy --upgrade ");
        system("pip install pandas --upgrade ");
        system("pip install matplotlib --upgrade ");
        system("pip install scipy --upgrade ");
        system("pip install flask --upgrade ");
        system("pip install django --upgrade ");
        system("pip install fastapi --upgrade ");
        system("pip install sqlalchemy --upgrade ");
        system("pip install pytest --upgrade ");
        system("pip install black --upgrade ");
        system("pip install mypy --upgrade ");
        system("pip install jupyter --upgrade ");
        system("pip install notebook --upgrade ");
        system("pip install ipython --upgrade ");
        system("pip install virtualenv --upgrade ");
        system("pip install pipenv --upgrade ");
        system("pip install poetry --upgrade ");
        system("pip install sphinx --upgrade ");
        system("pip install twine --upgrade ");
        system("pip install setuptools --upgrade ");
        system("pip install wheel --upgrade ");
        system("pip install cython --upgrade ");
        system("pip install pyyaml --upgrade ");
        system("pip install cryptography --upgrade ");
        system("pip install paramiko --upgrade ");
        system("pip install fabric --upgrade ");
        system("pip install celery --upgrade ");
        system("pip install redis --upgrade ");
        system("pip install sqlparse --upgrade ");
        system("pip install pytest-cov --upgrade ");
        system("pip install coverage --upgrade ");
        system("pip install flake8 --upgrade ");
        system("pip install pylint --upgrade ");
        system("pip install autopep8 --upgrade ");
        system("pip install isort --upgrade ");
        system("pip install rope --upgrade ");
        system("pip install jedi --upgrade ");
        system("pip install watchdog --upgrade ");
        system("pip install httpx --upgrade ");
        system("pip install starlette --upgrade ");
        system("pip install uvicorn --upgrade ");
        system("pip install gunicorn --upgrade ");
        system("pip install gevent --upgrade ");
        system("pip install eventlet --upgrade ");
        system("pip install twisted --upgrade ");
        system("pip install bottle --upgrade ");
        system("pip install cherrypy --upgrade ");
        system("pip install hug --upgrade ");
        system("pip install connexion --upgrade ");
        system("pip install falcon --upgrade ");
        system("pip install pydantic --upgrade ");
        system("pip install orjson --upgrade ");
        system("pip install ujson --upgrade ");
        system("pip install simplejson --upgrade ");
        system("pip install pycryptodome --upgrade ");
        system("pip install bcrypt --upgrade ");
        system("pip install argon2-cffi --upgrade ");
        system("pip install passlib --upgrade ");
        system("pip install pyjwt --upgrade ");
        system("pip install python-dotenv --upgrade ");
        system("pip install loguru --upgrade ");
        system("pip install structlog --upgrade ");
        system("pip install rich --upgrade ");
        system("pip install textual --upgrade ");
        system("pip install prompt-toolkit --upgrade ");
        system("pip install click --upgrade ");
        system("pip install typer --upgrade ");
        system("pip install fire --upgrade ");
        system("pip install argparse --upgrade ");
        system("pip install docopt --upgrade ");
        system("pip install pydoc --upgrade ");
        system("pip install mkdocs --upgrade ");
        system("pip install mkdocs-material --upgrade ");
        system("pip install sphinx-rtd-theme --upgrade ");
        system("pip install alabaster --upgrade ");
        system("pip install nbsphinx --upgrade ");
        system("pip install sphinx-autodoc-typehints --upgrade ");
        system("pip install sphinxcontrib-napoleon --upgrade ");
        system("pip install pytest-django --upgrade ");
        system("pip install pytest-flask --upgrade ");
        system("pip install pytest-asyncio --upgrade ");
        system("pip install pytest-mock --upgrade ");
        system("pip install pytest-xdist --upgrade ");
        system("pip install pytest-benchmark --upgrade ");
        system("pip install pytest-sugar --upgrade ");
        system("pip install pytest-html --upgrade ");
        system("pip install pytest-cases --upgrade ");
        system("pip install pytest-timeout --upgrade ");
        system("pip install pytest-rerunfailures --upgrade ");
        system("pip install pytest-ordering --upgrade ");
        system("pip install pytest-env --upgrade ");
        system("pip install pytest-profiling --upgrade ");
        system("pip install pytest-lazy-fixture --upgrade ");
        system("pip install bs4 --upgrade ");
        system("pip install scrapy --upgrade ");
        system("pip install selenium --upgrade ");
        system("pip install playwright --upgrade ");
        system("pip install httpie --upgrade ");
        system("pip install mitmproxy --upgrade ");
        system("pip install locust --upgrade ");
        system("pip install jmespath --upgrade ");
        system("pip install jsonschema --upgrade ");
        system("pip install pydash --upgrade ");
        system("pip install toolz --upgrade ");
        system("pip install cytoolz --upgrade ");
        system("pip install boltons --upgrade ");
        system("pip install more-itertools --upgrade ");
        system("pip install funcy --upgrade ");
        system("pip install dataclasses --upgrade ");
        system("pip install attrs --upgrade ");
        system("pip install pyrsistent --upgrade ");
        system("pip install pytorch --upgrade ");
        system("pip install tensorflow --upgrade ");
        system("pip install keras --upgrade ");
        system("pip install transformers --upgrade ");
        system("pip install datasets --upgrade ");
        system("pip install opencv-python --upgrade ");
        system("pip install scikit-learn --upgrade ");
        system("pip install xgboost --upgrade ");
        system("pip install lightgbm --upgrade ");
        system("pip install catboost --upgrade ");
        system("pip install fastai --upgrade ");
        system("pip install albumentations --upgrade ");
        system("pip install imgaug --upgrade ");
        system("pip install nltk --upgrade ");
        system("pip install openai --upgrade ");
        system("pip install langchain --upgrade ");
        system("pip install streamlit --upgrade ");
        system("pip install dash --upgrade ");
        system("pip install pygame --upgrade ");
        system("pip install pydub --upgrade ");
        system("pip install moviepy --upgrade ");
        system("pip install ffmpeg-python --upgrade ");
        system("pip install pyqt5 --upgrade ");
        system("pip install pyside2 --upgrade ");
        system("pip install kivy --upgrade ");
        cout << "Libraries updated successfully." << endl;
        cout << "Updating Python package..." << endl;
        system("pip install --upgrade pip");
        cout << "Python package updated successfully." << endl;
        return 0;
    } else if (argv[1] == "uninstall" && (argv[2] == "-pl" || argv[2] == nullptr)) { // Remove python libraries
        cout << "Removing Python Libraries..." << endl;
        system("pip uninstall pyinstaller");
        system("pip uninstall tqdm");
        system("pip uninstall requests");
        system("pip uninstall lxml");
        system("pip uninstall pillow");
        system("pip uninstall numpy");
        system("pip uninstall pandas");
        system("pip uninstall matplotlib");
        system("pip uninstall scipy");
        system("pip uninstall flask");
        system("pip uninstall django");
        system("pip uninstall fastapi");
        system("pip uninstall sqlalchemy");
        system("pip uninstall pytest");
        system("pip uninstall black");
        system("pip uninstall mypy");
        system("pip uninstall jupyter");
        system("pip uninstall notebook");
        system("pip uninstall ipython");
        system("pip uninstall virtualenv");
        system("pip uninstall pipenv");
        system("pip uninstall poetry");
        system("pip uninstall sphinx");
        system("pip uninstall twine");
        system("pip uninstall setuptools");
        system("pip uninstall wheel");
        system("pip uninstall cython");
        system("pip uninstall pyyaml");
        system("pip uninstall cryptography");
        system("pip uninstall paramiko");
        system("pip uninstall fabric");
        system("pip uninstall celery");
        system("pip uninstall redis");
        system("pip uninstall sqlparse");
        system("pip uninstall pytest-cov");
        system("pip uninstall coverage");
        system("pip uninstall flake8");
        system("pip uninstall pylint");
        system("pip uninstall autopep8");
        system("pip uninstall isort");
        system("pip uninstall rope");
        system("pip uninstall jedi");
        system("pip uninstall watchdog");
        system("pip uninstall httpx");
        system("pip uninstall starlette");
        system("pip uninstall uvicorn");
        system("pip uninstall gunicorn");
        system("pip uninstall gevent");
        system("pip uninstall eventlet");
        system("pip uninstall twisted");
        system("pip uninstall bottle");
        system("pip uninstall cherrypy");
        system("pip uninstall hug");
        system("pip uninstall connexion");
        system("pip uninstall falcon");
        system("pip uninstall pydantic");
        system("pip uninstall orjson");
        system("pip uninstall ujson");
        system("pip uninstall simplejson");
        system("pip uninstall pycryptodome");
        system("pip uninstall bcrypt");
        system("pip uninstall argon2-cffi");
        system("pip uninstall passlib");
        system("pip uninstall pyjwt");
        system("pip uninstall python-dotenv");
        system("pip uninstall loguru");
        system("pip uninstall structlog");
        system("pip uninstall rich");
        system("pip uninstall textual");
        system("pip uninstall prompt-toolkit");
        system("pip uninstall click");
        system("pip uninstall typer");
        system("pip uninstall fire");
        system("pip uninstall argparse");
        system("pip uninstall docopt");
        system("pip uninstall pydoc");
        system("pip uninstall mkdocs");
        system("pip uninstall mkdocs-material");
        system("pip uninstall sphinx-rtd-theme");
        system("pip uninstall alabaster");
        system("pip uninstall nbsphinx");
        system("pip uninstall sphinx-autodoc-typehints");
        system("pip uninstall sphinxcontrib-napoleon");
        system("pip uninstall pytest-django");
        system("pip uninstall pytest-flask");
        system("pip uninstall pytest-asyncio");
        system("pip uninstall pytest-mock");
        system("pip uninstall pytest-xdist");
        system("pip uninstall pytest-benchmark");
        system("pip uninstall pytest-sugar");
        system("pip uninstall pytest-html");
        system("pip uninstall pytest-cases");
        system("pip uninstall pytest-timeout");
        system("pip uninstall pytest-rerunfailures");
        system("pip uninstall pytest-ordering");
        system("pip uninstall pytest-env");
        system("pip uninstall pytest-profiling");
        system("pip uninstall pytest-lazy-fixture");
        system("pip uninstall bs4");
        system("pip uninstall scrapy");
        system("pip uninstall selenium");
        system("pip uninstall playwright");
        system("pip uninstall httpie");
        system("pip uninstall mitmproxy");
        system("pip uninstall locust");
        system("pip uninstall jmespath");
        system("pip uninstall jsonschema");
        system("pip uninstall pydash");
        system("pip uninstall toolz");
        system("pip uninstall cytoolz");
        system("pip uninstall boltons");
        system("pip uninstall more-itertools");
        system("pip uninstall funcy");
        system("pip uninstall dataclasses");
        system("pip uninstall attrs");
        system("pip uninstall pyrsistent");
        system("pip uninstall pytorch");
        system("pip uninstall tensorflow");
        system("pip uninstall keras");
        system("pip uninstall transformers");
        system("pip uninstall datasets");
        system("pip uninstall opencv-python");
        system("pip uninstall scikit-learn");
        system("pip uninstall xgboost");
        system("pip uninstall lightgbm");
        system("pip uninstall catboost");
        system("pip uninstall fastai");
        system("pip uninstall albumentations");
        system("pip uninstall imgaug");
        system("pip uninstall nltk");
        system("pip uninstall openai");
        system("pip uninstall langchain");
        system("pip uninstall streamlit");
        system("pip uninstall dash");
        system("pip uninstall pygame");
        system("pip uninstall pydub");
        system("pip uninstall moviepy");
        system("pip uninstall ffmpeg-python");
        system("pip uninstall pyqt5");
        system("pip uninstall pyside2");
        system("pip uninstall kivy");
    } else if (argv[1] == "uninstall" && (argv[2] == "-sf")) {
        cout << "Removing all packages & core software. are you sure? (Y/n)" << endl;
        char c;
        cin >> c;
        if (c == 'Y' || c == 'y')
            system("rm ./*");
        else
            cout << "Control Cancel" << endl;
    } else {
        cout << "E: Unknown command '" << argv[1] << "'." << endl;
        cout << "Usage: DevToolbox <command>" << endl;
        cout << "Available commands: init, navigator" << endl;
        return 1;
    }
}